package cn.ljy.uem.model;

import cn.ljy.common.model.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @description 专业群和群主关系
 * @author 王秋林
 * @date 2022-7-20 10:41
 */
@ApiModel(value = "专业群和群主关系")
@Data
@NoArgsConstructor
public class SchoolMajorGroupTeacher extends BaseModel {
    @NotNull(message = "专业群Id不能为空")
    private Integer majorGroupId;//专业群Id

    @ApiModelProperty(value = "专业群群主")
    @NotNull(message = "专业群群主不能为空")
    private Long teacherId;//专业群群主

    @ApiModelProperty(value = "群主类型（1、群主，2、副群主、3其他类型）")
    @NotNull(message = "群主类型不能为空")
    @Range(min = 1,max = 9,message = "群主类型的数值必须在{min} - {max}之间")
    private Integer type;//群主类型

    private Date createTime;//创建时间

    private Date  updateTime;//修改时间

    //非数据库字段
    private SchoolMajorGroup schoolMajorGroup;//所属专业群信息
    private SchoolTeacher schoolTeacher;//所对应的群主信息

    public SchoolMajorGroupTeacher(SchoolMajorGroup schoolMajorGroup, SchoolTeacher schoolTeacher) {
        this.schoolMajorGroup = schoolMajorGroup;
        this.schoolTeacher = schoolTeacher;
    }
}
